package org.stwy.pro.safe;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.stwy.pro.asset.AssetEntity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.rap.common.annotation.MetaData;
import com.rap.common.entity.BaseEntity;

/**
*版权信息 (c) RAP 保留所有权利.
*@author Rap.Codegen
*@Team RAP Team
*@Date 2015-4-9 22:27:09
*<p></p>
*
*@参与人：Rap.Codegen
*/
 
@MetaData(value = "物业安全状况")
@Entity
@Table(name = "stwy_safe")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SafeEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;
	@MetaData(value = "检查日期",comments="" )
	@Column(nullable = false)
	@Temporal(TemporalType.DATE)
	private Date checkDate;
	
	@MetaData(value = "资产")
	@ManyToOne(optional = false)
	@JoinColumn(name = "assetId")
	private AssetEntity asset=new AssetEntity();
	
	@MetaData(value = "安全状况",comments="",enumType="stwy_safeState" )
	@Column(nullable = true,length = 4)
	private String safeState;
	
	@MetaData(value = "安全描述",comments="" )
	@Column(nullable = true,length = 1000)
	private String description;
	
	@MetaData(value = "备注",comments="" )
	@Column(nullable = true,length = 1000)
	private String remark;
	
	
	/**
	 * 检查日期
	 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getCheckDate(){
		return this.checkDate;
	}
	public void setCheckDate(Date checkDate){
		this.checkDate = checkDate;
	}
	/**
	 * 资产
	 */
	public AssetEntity getAsset() {
		return asset;
	}
	public void setAsset(AssetEntity asset) {
		this.asset = asset;
	}
	/**
	 * 安全状况
	 */
	public String getSafeState(){
		return this.safeState;
	}
	public void setSafeState(String safeState){
		this.safeState = safeState;
	}
	/**
	 * 安全描述
	 */
	
	/**
	 * 备注
	 */
	public String getRemark(){
		return this.remark;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public void setRemark(String remark){
		this.remark = remark;
	}
}
